﻿using System;
using UnityEngine;

namespace Assets.Scripts.ProceduralCityGenerator
{
	// Token: 0x02000346 RID: 838
	public class DebrisHandler : MonoBehaviour
	{
		// Token: 0x060015D1 RID: 5585 RVA: 0x0008DC9C File Offset: 0x0008BE9C
		private void OnCollisionEnter(Collision collision)
		{
			Micro component = collision.gameObject.GetComponent<Micro>();
			if (component && GlobalPreferences.DebrisCanCrush.value)
			{
				Collider component2 = base.gameObject.GetComponent<Collider>();
				if (!component2)
				{
					return;
				}
				float num = component2.bounds.max.y * 0.5f;
				float heightMesh = component.HeightMesh;
				if (num > heightMesh)
				{
					component.Crush(null, new Micro.CollisionData(collision));
				}
			}
		}
	}
}
